import request from '@/utils/http'

const apiList = {
    category: 'question_knowledge/findAll',
    addUpdateCategory: 'question_knowledge/save',
    toptic: 'question/list',
    deleteMultipleSelection: 'question/deleteQuestions',
    deleteToptic: 'question/delete',
    addToptic: 'question/save',
    getTopticDetail: 'question/findQuestionById',
    updateToptic: 'question/update'
}

export default {
    category: data => {
        return request.get(apiList.category, { params: data })
    },
    addUpdateCategory: data => {
        return request.post(apiList.addUpdateCategory, data)
    },
    deleteCategory: data => {
        return request.delete(`question_knowledge/deleteById/${data.id}`)
    },
    toptic: data => {
        return request.post(apiList.toptic, data)
    },
    deleteMultipleSelection: data => {
        return request.post(apiList.deleteMultipleSelection + '?ids=' + data.ids)
    },
    deleteToptic: data => {
        return request.delete(apiList.deleteToptic, { params: data })
    },
    addToptic: data => {
        return request.post(apiList.addToptic, data)
    },
    getTopticDetail: data => {
        return request.get(apiList.getTopticDetail, { params: data })
    },
    updateToptic: data => {
        return request.post(apiList.updateToptic, data)
    },
}